<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>注册</title>
    <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.5.css"/>
    <script src="js/jquery-2.1.4.js"></script>
    <script src="js/jquery.mobile-1.4.5.js"></script>
    <script>
        $(function(){

            $("#reg").click(function(){
//                console.log($(".username"));
                var username=$("#username").val();
                var password=$("#password").val();

                var user=new Object();
                user.name=username;
                user.password=password;
                localStorage.setItem(username,JSON.stringify(user));

                window.location.href="index.html";
//                $.mobile.changePage("index.html");
            });
        })

    </script>


</head>
<body>
    <div data-role="page">
        <div data-role="header" data-disable-page-zoom="false" data-position="fixed">
            <h1>注册</h1>
        </div>
        <div data-role="content">

            <form>
                <div data-role="fieldcontail">

                    <label for="username">用户名：</label>
                    <input type="text" name="username" id="username">

                    <label for="password">密码</label>
                    <input type="password" name="password" id="password">
                    <label for="confirmPsw">确认密码</label>
                    <input type="password" name="password" id="confirmPsw">
                    <input type="button" id="reg" value="提交">
                    <input type="reset" value="重置">

                </div>

            </form>

        </div>
        <div data-role="footer" data-disable-page-zoom="false" data-position="fixed">
            <h1>RJ.lesson.lrj&hzs</h1>
        </div>
    </div>

</body>
</html>